<% page_title "Secrets Duplicates" %>
<h1>
  Secrets Duplicates
  <%= render "header" %>
</h1>

<section class="clearfix">
  <table class="table table-hover table-condensed">
    <thead>
      <tr>
        <th>Environment</th>
        <th>Project</th>
        <th>Deploy Group</th>
        <th>Key</th>
        <th></th>
      </tr>
    </thead>

    <tbody>
      <% @groups.each do |hash, group| %>
        <tr><td>Group <%= link_to hash, secrets_path(search: {value_hashed: hash}) %></td></tr>
        <% group.each do |id, secret_stub| %>
          <% parts = Samson::Secrets::Manager.parse_id(id) %>
          <%= render "row", id: id, parts: parts, secret_stub: secret_stub %>
        <% end %>
      <% end %>
    </tbody>
  </table>
</section>
